/**
 *@author Randy Dane
 * @category GUI / Applicatie
 * @name sjabloon_aanpassen.js
 * @version 0.1
 * 
 * @copyright Randy Dane
 * 
 */
jQuery(document).ready(function(){    
    var rag_row_id =  1;
    var rg_row_id = 1;
    var risico_row_id = 1;
    var pm_row_id = 1;
        
    jQuery('span#rag_plus').click(function(){        
        add_rag_row();
        rag_row_id++;
        rg_row_id++;
        risico_row_id++;
        pm_row_id++;
    })
    
   jQuery('span#rg_plus').click(function(){     
        add_rg_row();
        rg_row_id++;
        risico_row_id++;
        pm_row_id++;
        alert(rg_row_id);
    })
    
    jQuery('span#risico_plus').click(function(){
        add_risico_row();
        risico_row_id++;
        pm_row_id++;
    })
    
    jQuery('span#pm_plus').click(function(){
        add_pm_row();
        pm_row_id++;
    })
    
function add_rag_row(){
   
    var pm_row = '<td style="background-color: #FFFFFF; color: #000000; font-size:14px"><input name="maatregel_' + pm_row_id + '" type="text" style="width:91%;" value="nieuwe maatregel" /></td></tr>'
    var risico_row = '<td style="background-color: #FFFFFF; color: #000000; font-size:14px" ><input type="text" name="risico_' + risico_row_id + '" style="width:91%;" value="Nieuw risico" /></td>' + pm_row
    var rg_row = '<tr><td><input type="text" name="risicogebied_' + rg_row_id + '" style="width:91%;" value="Nieuw risicogebied" /></td>' + risico_row
    var rag_row = '<tr style="background-color: #DBD9D6; color: #000000; font-size:16px ;" id="' + rag_row_id + '"><td colspan="3">Risico&#39s van <input type="text" value="Nieuw Risicoaandachtsgebied" name="risicoaandachtsgebied_' + rag_row_id + '"/></td></tr>' + rg_row
   
    jQuery('#sjabloon').append(rag_row);
}

function add_rg_row(){

    var pm_row = '<td style="background-color: #FFFFFF; color: #000000; font-size:14px"><input name="maatregel_' + pm_row_id + '" type="text" style="width:91%;" value="nieuwe maatregel" /></td></tr>'
    var risico_row = '<td style="background-color: #FFFFFF; color: #000000; font-size:14px" ><input type="text" name="risico_' + risico_row_id + '" style="width:91%;" value="Nieuw risico" /></td>' + pm_row
    var rg_row = '<tr><td><input type="text" name="risicogebied_' + rg_row_id + '" style="width:91%;" value="Nieuw risicogebied" /></td>' + risico_row
    
    jQuery('#sjabloon').append(rg_row);
}

function add_risico_row(){
    var pm_row = '<td style="background-color: #FFFFFF; color: #000000; font-size:14px"><input name="maatregel_' + pm_row_id + '" type="text" style="width:91%;" value="nieuwe maatregel" /></td></tr>'
    var risico_row = '<tr><td>&nbsp;</td><td style="background-color: #FFFFFF; color: #000000; font-size:14px" ><input type="text" name="risico_' + risico_row_id + '" style="width:91%;" value="Nieuw risico" /></td>' + pm_row
    jQuery('#sjabloon').append(risico_row);
}

function add_pm_row(){
     var pm_row = '<tr><td>&nbsp;</td><td>&nbsp;</td><td style="background-color: #FFFFFF; color: #000000; font-size:14px"><input name="maatregel_' + pm_row_id + '" type="text" style="width:91%;" value="nieuwe maatregel" /></td></tr>'
    jQuery('#sjabloon').append(pm_row);
}
})